﻿using System;

namespace FWPDocumentation.Common
{
    public static class TypeTools
    {
        public static T GetDefaultValue<T>()
        {
            if (typeof(T) == typeof(int))
            {
                return (T)Convert.ChangeType(0, Type.GetTypeCode(typeof(T)));
            }
            if (typeof(T) == typeof(string))
            {
                return (T)Convert.ChangeType(string.Empty, Type.GetTypeCode(typeof(T)));
            }
            return (T)Convert.ChangeType(null, Type.GetTypeCode(typeof(T)));
        }
    }
}
